package com.bdqn.service.impl;

import com.bdqn.dao.BookDao;
import com.bdqn.dao.impl.BookDaoImpl;
import com.bdqn.entity.Book;
import com.bdqn.service.BookService;

import java.util.List;

/**
 * BookServiceImpl 图书Service实现类
 *
 * @author LILIBO
 * @since 2024/4/27
 */
public class BookServiceImpl implements BookService {

    // 引入图书DAO层
    private final BookDao bookDao = new BookDaoImpl();

    /**
     * 添加图书
     *
     * @param book
     * @return
     */
    @Override
    public int add(Book book) {
        return bookDao.add(book);
    }

    /**
     * 修改图书
     *
     * @param book
     * @return
     */
    @Override
    public int upd(Book book) {
        return bookDao.upd(book);
    }

    /**
     * 删除图书
     *
     * @param bid
     * @return
     */
    @Override
    public int del(int bid) {
        return bookDao.del(bid);
    }

    /**
     * 查询列表
     *
     * @return
     */
    @Override
    public List<Book> list() {
        return bookDao.list();
    }

}
